Break proc paths out into separate include file, rather than inlining them.
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Fri, 21 Oct 2005 12:30:31 +0000 (13:30 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Fri, 21 Oct 2005 12:30:31 +0000 (13:30 +0100)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/xenstore/xenstored_domain.c
tools/xenstore/xenstored_proc.h [new file with mode: 0644]

index fd2bbdf691c878e359cb7caa127f2f5c5d8ab690..69e429ccfae843b8c9ab767c37cf1164f4a81c82 100644 (file)
@@ -33,6 +33,7 @@
 #include "talloc.h"
 #include "xenstored_core.h"
 #include "xenstored_domain.h"
+#include "xenstored_proc.h"
 #include "xenstored_watch.h"
 #include "xenstored_test.h"
 
@@ -449,7 +450,7 @@ static int dom0_init(void)
         char str[20]; 
         struct domain *dom0; 
         
-        fd = open("/proc/xen/xsd_mfn", O_RDONLY); 
+        fd = open(XENSTORED_PROC_MFN, O_RDONLY); 
         
         rc = read(fd, str, sizeof(str)); 
         str[rc] = '\0'; 
@@ -457,7 +458,7 @@ static int dom0_init(void)
         
         close(fd); 
         
-        fd = open("/proc/xen/xsd_port", O_RDONLY); 
+        fd = open(XENSTORED_PROC_PORT, O_RDONLY); 
         
         rc = read(fd, str, sizeof(str)); 
         str[rc] = '\0'; 
diff --git a/tools/xenstore/xenstored_proc.h b/tools/xenstore/xenstored_proc.h
new file mode 100644 (file)
index 0000000..d065b05
--- /dev/null
@@ -0,0 +1,27 @@
+/* 
+    Copyright (C) 2005 XenSource Ltd
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#ifndef _XENSTORED_PROC_H
+#define _XENSTORED_PROC_H
+
+#define XENSTORED_PROC_MFN  "/proc/xen/xsd_mfn"
+#define XENSTORED_PROC_PORT "/proc/xen/xsd_port"
+
+
+#endif /* _XENSTORED_PROC_H */